package com.ruoyi.hualian.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.hualian.mapper.HlShapeAxleMapper;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.hualian.domain.HlShapeAxle;
import com.ruoyi.hualian.service.IHlShapeAxleService;

/**
 * 形状-轴孔Service业务层处理
 * 
 * @author hujian
 */
@Service
public class HlShapeAxleServiceImpl implements IHlShapeAxleService
{
    @Autowired
    private HlShapeAxleMapper hlShapeAxleMapper;

    /**
     * 根据已知信息查询具体对象信息
     * @param shapeAxle 已知信息
     * @return 具体对象信息
     */
    @Override
    public HlShapeAxle selectOne(HlShapeAxle shapeAxle) {
        LambdaQueryWrapper<HlShapeAxle> hlShapeAxleWrapper = new LambdaQueryWrapper<>();

        hlShapeAxleWrapper.eq(HlShapeAxle::getSphapeMark, shapeAxle.getSphapeMark())
                        .eq(HlShapeAxle::getAxleMark, shapeAxle.getAxleMark());

        return hlShapeAxleMapper.selectOne(hlShapeAxleWrapper);
    }

    /**
     * 根据已知信息查询具体对象信息
     * @param hlShapeAxle 已知信息
     * @return 具体对象信息
     */
    @Override
    public List<HlShapeAxle> selectList(HlShapeAxle hlShapeAxle) {
        LambdaQueryWrapper<HlShapeAxle> hlShapeAxleWrapper = new LambdaQueryWrapper<>();
        if (ObjectUtils.isNotEmpty(hlShapeAxle.getAxleMark())) {
            hlShapeAxleWrapper.eq(HlShapeAxle::getAxleMark, hlShapeAxle.getAxleMark());
        }
        hlShapeAxleWrapper.eq(HlShapeAxle::getAffiliation, hlShapeAxle.getAffiliation());
        return hlShapeAxleMapper.selectList(hlShapeAxleWrapper);
    }


    /**
     * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     */


    /**
     * 查询形状-轴孔
     * 
     * @param sphapeAxleId 形状-轴孔主键
     * @return 形状-轴孔
     */
    @Override
    public HlShapeAxle selectHlShapeAxleBySphapeAxleId(Long sphapeAxleId)
    {
        return hlShapeAxleMapper.selectHlShapeAxleBySphapeAxleId(sphapeAxleId);
    }

    /**
     * 查询形状-轴孔列表
     * 
     * @param hlShapeAxle 形状-轴孔
     * @return 形状-轴孔
     */
    @Override
    public List<HlShapeAxle> selectHlShapeAxleList(HlShapeAxle hlShapeAxle)
    {
        return hlShapeAxleMapper.selectHlShapeAxleList(hlShapeAxle);
    }

    /**
     * 新增形状-轴孔
     * 
     * @param hlShapeAxle 形状-轴孔
     * @return 结果
     */
    @Override
    public int insertHlShapeAxle(HlShapeAxle hlShapeAxle)
    {
        return hlShapeAxleMapper.insertHlShapeAxle(hlShapeAxle);
    }

    /**
     * 修改形状-轴孔
     * 
     * @param hlShapeAxle 形状-轴孔
     * @return 结果
     */
    @Override
    public int updateHlShapeAxle(HlShapeAxle hlShapeAxle)
    {
        return hlShapeAxleMapper.updateHlShapeAxle(hlShapeAxle);
    }

    /**
     * 批量删除形状-轴孔
     * 
     * @param sphapeAxleIds 需要删除的形状-轴孔主键
     * @return 结果
     */
    @Override
    public int deleteHlShapeAxleBySphapeAxleIds(Long[] sphapeAxleIds)
    {
        return hlShapeAxleMapper.deleteHlShapeAxleBySphapeAxleIds(sphapeAxleIds);
    }

    /**
     * 删除形状-轴孔信息
     * 
     * @param sphapeAxleId 形状-轴孔主键
     * @return 结果
     */
    @Override
    public int deleteHlShapeAxleBySphapeAxleId(Long sphapeAxleId)
    {
        return hlShapeAxleMapper.deleteHlShapeAxleBySphapeAxleId(sphapeAxleId);
    }
}
